class Solution:
    def reverseWords(self, s: str) -> str:
        s_tmp = s.split(' ')
        ans = []
        for it in s_tmp:
            new_s = ""
            for i in range(len(it) - 1, -1, -1):
                new_s += it[i]
            ans.append(new_s)
            ans.append(' ')
        return "".join(ans).strip(' ')
